package com.wn.controller;

import com.wn.bean.User;
import com.wn.mapper.UserMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {

    @Resource
    private UserMapper userMapper;

    @GetMapping("/insert")
    public String insert() {
        User user = new User();
        user.setId(1);
        user.setName("zhangsan");
        userMapper.save(user);
        return "success";
    }
}